import React, {Component} from 'react';

class App extends Component {
    myRef = React.createRef();

    render() {
        return (<div>
            <input ref={this.myRef}/>
            <button onClick={() => console.log(this.myRef.current.value)}>提交</button>
        </div>);
    }
}

export default App;